﻿using NuGet;

namespace Exocortex.Excel.Nuget
{
    public class WebPackageSource : PackageSource
    {
        public WebPackageSource(string source, string name) : base(source, name)
        {
        }

        public override bool Equals(object obj)
        {
            WebPackageSource source = obj as WebPackageSource;
            return (base.Equals((PackageSource) source) && (this.FilterPreferredPackages == source.FilterPreferredPackages));
        }

        public override int GetHashCode()
        {
            return (base.GetHashCode() ^ (this.FilterPreferredPackages ? 1 : 0));
        }

        public bool FilterPreferredPackages
        { get; set; }
    }
}

